package com.project.bookstore.order.pojo;

import com.baomidou.mybatisplus.annotation.EnumValue;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Arrays;
import java.util.HashMap;


@Data
@AllArgsConstructor
@NoArgsConstructor
public class CountStateEntity {
    /**
     * 订单状态枚举类
     */
    private OrderState state;
    /**
     * 订单状态统计值
     */
    private Integer count;
    /**
     * 初始默认结果集合
     */
    private static HashMap<String ,Integer> initMap;

    public static HashMap<String, Integer> getInitMap() {
        initMap = new HashMap<>(6);
        OrderState[] values = OrderState.values();
        for (OrderState orderState : values) {
            initMap.put(orderState.getStateName(), 0);
        }
        return initMap;
    }

    public String getStateName(){
        return state.getStateName();
    }

}


